#!/bin/bash
#install edusoho
Mysql_Pass=QianFeng@123

#update
#yum update

#epel
yum -y install epel-release

#env
yum -y install bash-completion vim wget
systemctl restart firewalld
systemctl enable firewalld

setenforce 0

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-port=8080/tcp
firewall-cmd --reload

#LAMP
yum -y install httpd
yum -y install \
php php-mysqlnd \
gd \
php-gd


yum -y install mariadb-server mariadb

#apache
rm -rf /etc/httpd/conf.d/welcome.conf
#sed -ri 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf
systemctl enable httpd

#mysql
systemctl start mariadb
systemctl enable mariadb

mysqladmin -uroot password "$Mysql_Pass"
mysql -uroot -p"$Mysql_Pass" -e "create database  discuz"


#edusoho
wget https://gitee.com/Discuz/DiscuzX/attach_files/1309965/download
yum  install  -y   unzip
unzip  download
cp -rf upload/* /var/www/html
chown -R  apache.apache  /var/www/html


systemctl restart httpd mariadb
